function d_print(...)
	if IS_DEBUG then
		print(...)
	end
end

table = table or {}
function table.empty(t)
	return _G.next( t ) == nil
end
--
-------------------------------------------
--print table by YunFeng
local print = print
local tconcat = table.concat
local tinsert = table.insert
local srep = string.rep
local type = type
local pairs = pairs
local tostring = tostring
local next = next

function print_r(root)
    local cache = {  [root] = "." }
    local function _dump(t,space,name)
        local temp = {}
        for k,v in pairs(t) do
            local key = tostring(k)
            if cache[v] then
                tinsert(temp,"+" .. key .. " {" .. cache[v].."}")
            elseif type(v) == "table" then
                local new_key = name .. "." .. key
                cache[v] = new_key
                tinsert(temp,"+" .. key .. _dump(v,space .. (next(t,k) and "|" or " " ).. srep(" ",#key),new_key))
            else
                tinsert(temp,"+" .. key .. " [" .. tostring(v).."]")
            end
        end
        return tconcat(temp,"\n"..space)
    end
    print(_dump(root, "",""))
end
--------------------------------------------

function subTimeString(curTm, restoreTm)
    -- local restoreTm = os.date("*t", self.rstsec)
    local subsec = restoreTm.sec - curTm.sec
    local adjust_min = 0
    if subsec < 0 then 
        subsec = 60 + subsec
        adjust_min = -1
    end

    local submin = restoreTm.min - curTm.min
    submin = submin + adjust_min
    if submin < 0 then
        submin = 60 + submin
    end

    return string.format("%d:%02d", submin,subsec)
end


---------------------------------------------

g_targetPlatform = cc.Application:getInstance():getTargetPlatform()
if cc.PLATFORM_OS_ANDROID == g_targetPlatform then
    luaj = require "luaj"
end

require "math2d"
require "appInfo"
require "ppConst"
require "cocosBase"
require "resMgr"

require "util/serialize"


 